﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AWA.VAT.GuestRelations.Controllers;

namespace AWA.VAT.GuestRelations.Views
{
    public partial class LoadForm : Form
    {
        private LoadController _controller;

        public bool ReadEnabled
        {
            get { return btnLoadEditors.Enabled; }
            set { btnLoadEditors.Enabled = value; }
        }

        public bool SaveEnabled
        {
            get { return btnSave.Enabled; }
            set { btnSave.Enabled = value; }
        }

        public LoadForm(LoadController controller)
        {
            InitializeComponent();
            this._controller = controller;
        }

        private void btnSpreadsheet_Click(object sender, EventArgs e)
        {
            _controller.LoadSpreadsheet();
        }

        private void btnLoadEditors_Click(object sender, EventArgs e)
        {
            _controller.LoadExcelFileContents();
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            _controller.CommitToDB();
        }
    }
}
